<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::GibbsOperator&lt; RBMType &gt; Class Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_gibbs_operator.html">GibbsOperator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_gibbs_operator-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::GibbsOperator&lt; RBMType &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Implements Block Gibbs Sampling related transition operators for various temperatures.  
 <a href="classshark_1_1_gibbs_operator.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_gibbs_operator_8h_source.html">shark/Unsupervised/RBM/Sampling/GibbsOperator.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a9de44a00cd05bc1736b0503d25af6bd4" id="r_a9de44a00cd05bc1736b0503d25af6bd4"><td class="memItemLeft" align="right" valign="top">typedef RBMType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a9de44a00cd05bc1736b0503d25af6bd4">RBM</a></td></tr>
<tr class="separator:a9de44a00cd05bc1736b0503d25af6bd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcd709448bd459283e37ddde0d15e7fd" id="r_abcd709448bd459283e37ddde0d15e7fd"><td class="memItemLeft" align="right" valign="top">typedef detail::GibbsSample&lt; typename RBMType::HiddenType::SufficientStatistics &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#abcd709448bd459283e37ddde0d15e7fd">HiddenSample</a></td></tr>
<tr class="memdesc:abcd709448bd459283e37ddde0d15e7fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">the type of a concrete sample.  <br /></td></tr>
<tr class="separator:abcd709448bd459283e37ddde0d15e7fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41de7989f5420650970b7b4f024b7356" id="r_a41de7989f5420650970b7b4f024b7356"><td class="memItemLeft" align="right" valign="top">typedef detail::GibbsSample&lt; typename RBMType::VisibleType::SufficientStatistics &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a41de7989f5420650970b7b4f024b7356">VisibleSample</a></td></tr>
<tr class="memdesc:a41de7989f5420650970b7b4f024b7356"><td class="mdescLeft">&#160;</td><td class="mdescRight">the type of a concrete sample.  <br /></td></tr>
<tr class="separator:a41de7989f5420650970b7b4f024b7356"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b57c0bacafe33d8d3ed614d4dd5d6dd" id="r_a5b57c0bacafe33d8d3ed614d4dd5d6dd"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt; <a class="el" href="classshark_1_1_gibbs_operator.html#abcd709448bd459283e37ddde0d15e7fd">HiddenSample</a> &gt;::type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a></td></tr>
<tr class="memdesc:a5b57c0bacafe33d8d3ed614d4dd5d6dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the state of a batch of hidden samples and additional information required by the gradient.  <br /></td></tr>
<tr class="separator:a5b57c0bacafe33d8d3ed614d4dd5d6dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c5a9c2d399cebdb3e036a5803a1d28b" id="r_a0c5a9c2d399cebdb3e036a5803a1d28b"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt; <a class="el" href="classshark_1_1_gibbs_operator.html#a41de7989f5420650970b7b4f024b7356">VisibleSample</a> &gt;::type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a></td></tr>
<tr class="memdesc:a0c5a9c2d399cebdb3e036a5803a1d28b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the state of the visible units and additional information required by the gradient.  <br /></td></tr>
<tr class="separator:a0c5a9c2d399cebdb3e036a5803a1d28b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0ec0371d4776aba60fc305b8f10c53fb" id="r_a0ec0371d4776aba60fc305b8f10c53fb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a0ec0371d4776aba60fc305b8f10c53fb">GibbsOperator</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a9de44a00cd05bc1736b0503d25af6bd4">RBM</a> *<a class="el" href="classshark_1_1_gibbs_operator.html#a0f5eaa3488fc9152a26be8c4a9c11c41">rbm</a>, double alphaVisible=0, double alphaHidden=0)</td></tr>
<tr class="memdesc:a0ec0371d4776aba60fc305b8f10c53fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs the Operator using an allready defined Distribution to sample from.  <br /></td></tr>
<tr class="separator:a0ec0371d4776aba60fc305b8f10c53fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f5eaa3488fc9152a26be8c4a9c11c41" id="r_a0f5eaa3488fc9152a26be8c4a9c11c41"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classshark_1_1_gibbs_operator.html#a9de44a00cd05bc1736b0503d25af6bd4">RBM</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a0f5eaa3488fc9152a26be8c4a9c11c41">rbm</a> () const</td></tr>
<tr class="memdesc:a0f5eaa3488fc9152a26be8c4a9c11c41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the internal <a class="el" href="classshark_1_1_r_b_m.html" title="stub for the RBM class. at the moment it is just a holder of the parameter set and the Energy.">RBM</a>.  <br /></td></tr>
<tr class="separator:a0f5eaa3488fc9152a26be8c4a9c11c41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a119948b017a9d29cdf5f10e20f4ed556" id="r_a119948b017a9d29cdf5f10e20f4ed556"><td class="memTemplParams" colspan="2">template&lt;class BetaVector &gt; </td></tr>
<tr class="memitem:a119948b017a9d29cdf5f10e20f4ed556"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a119948b017a9d29cdf5f10e20f4ed556">precomputeHidden</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;visibleBatch, BetaVector const &amp;beta) const</td></tr>
<tr class="memdesc:a119948b017a9d29cdf5f10e20f4ed556"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates internal data needed for sampling the hidden units as well as requested information for the gradient.  <br /></td></tr>
<tr class="separator:a119948b017a9d29cdf5f10e20f4ed556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a196f8674930d1d17709900801f48243d" id="r_a196f8674930d1d17709900801f48243d"><td class="memTemplParams" colspan="2">template&lt;class BetaVector &gt; </td></tr>
<tr class="memitem:a196f8674930d1d17709900801f48243d"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a196f8674930d1d17709900801f48243d">precomputeVisible</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;visibleBatch, BetaVector const &amp;beta) const</td></tr>
<tr class="memdesc:a196f8674930d1d17709900801f48243d"><td class="mdescLeft">&#160;</td><td class="mdescRight">calculates internal data needed for sampling the visible units as well as requested information for the gradient  <br /></td></tr>
<tr class="separator:a196f8674930d1d17709900801f48243d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab653cc8b59970aa87a87c9c633ed3c14" id="r_ab653cc8b59970aa87a87c9c633ed3c14"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#ab653cc8b59970aa87a87c9c633ed3c14">sampleHidden</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;sampleBatch) const</td></tr>
<tr class="memdesc:ab653cc8b59970aa87a87c9c633ed3c14"><td class="mdescLeft">&#160;</td><td class="mdescRight">Samples a new batch of states of the hidden units using their precomputed statistics.  <br /></td></tr>
<tr class="separator:ab653cc8b59970aa87a87c9c633ed3c14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e93543dc92f11037c60bedb0451d9be" id="r_a4e93543dc92f11037c60bedb0451d9be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a4e93543dc92f11037c60bedb0451d9be">sampleVisible</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;sampleBatch) const</td></tr>
<tr class="memdesc:a4e93543dc92f11037c60bedb0451d9be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Samples a new batch of states of the visible units using their precomputed statistics.  <br /></td></tr>
<tr class="separator:a4e93543dc92f11037c60bedb0451d9be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25136037254735170f4abf1659a0c56f" id="r_a25136037254735170f4abf1659a0c56f"><td class="memTemplParams" colspan="2">template&lt;class BetaVector &gt; </td></tr>
<tr class="memitem:a25136037254735170f4abf1659a0c56f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a25136037254735170f4abf1659a0c56f">stepVH</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;visibleBatch, std::size_t numberOfSteps, BetaVector const &amp;beta)</td></tr>
<tr class="memdesc:a25136037254735170f4abf1659a0c56f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies the Gibbs operator a number of times to a given sample.  <br /></td></tr>
<tr class="separator:a25136037254735170f4abf1659a0c56f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cf9658a4eb72ac3dc3dbaa44a51c726" id="r_a6cf9658a4eb72ac3dc3dbaa44a51c726"><td class="memTemplParams" colspan="2">template&lt;class States , class BetaVector &gt; </td></tr>
<tr class="memitem:a6cf9658a4eb72ac3dc3dbaa44a51c726"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a6cf9658a4eb72ac3dc3dbaa44a51c726">createSample</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;visibleBatch, States const &amp;states, BetaVector const &amp;beta) const</td></tr>
<tr class="memdesc:a6cf9658a4eb72ac3dc3dbaa44a51c726"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates hidden/visible sample pairs from the states of the visible neurons, i.e. sets the visible units to the given states and samples hidden states based on the states of the visible units. This can directly be used to calculate the gradient.  <br /></td></tr>
<tr class="separator:a6cf9658a4eb72ac3dc3dbaa44a51c726"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a638bbd0ab5f18d7064c2d6fb9a4ac1db" id="r_a638bbd0ab5f18d7064c2d6fb9a4ac1db"><td class="memTemplParams" colspan="2">template&lt;class States &gt; </td></tr>
<tr class="memitem:a638bbd0ab5f18d7064c2d6fb9a4ac1db"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a638bbd0ab5f18d7064c2d6fb9a4ac1db">createSample</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;visibleBatch, States const &amp;states) const</td></tr>
<tr class="memdesc:a638bbd0ab5f18d7064c2d6fb9a4ac1db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates hidden/visible sample pairs from the states of the visible neurons, i.e. sets the visible units to the given states and samples hidden states based on the states of the visible units. This can directly be used to calculate the gradient.  <br /></td></tr>
<tr class="separator:a638bbd0ab5f18d7064c2d6fb9a4ac1db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ba4607be52c15e7e69f8c10fa9ccf65" id="r_a8ba4607be52c15e7e69f8c10fa9ccf65"><td class="memItemLeft" align="right" valign="top">RealVector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a8ba4607be52c15e7e69f8c10fa9ccf65">calculateEnergy</a> (<a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> const &amp;hiddenBatch, <a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> const &amp;visibleBatch) const</td></tr>
<tr class="memdesc:a8ba4607be52c15e7e69f8c10fa9ccf65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the <a class="el" href="structshark_1_1_energy.html" title="The Energy function determining the Gibbs distribution of an RBM.">Energy</a> of a sample of the visible and hidden neurons created by this chain.  <br /></td></tr>
<tr class="separator:a8ba4607be52c15e7e69f8c10fa9ccf65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b86661eecf7572addeb9c6c2ea50711" id="r_a5b86661eecf7572addeb9c6c2ea50711"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b86661eecf7572addeb9c6c2ea50711">setAlpha</a> (double newAlphaVisible, double newAlphaHidden)</td></tr>
<tr class="separator:a5b86661eecf7572addeb9c6c2ea50711"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class RBMType&gt;<br />
class shark::GibbsOperator&lt; RBMType &gt;</div><p>Implements Block Gibbs Sampling related transition operators for various temperatures. </p>
<p>The operator generates transitions from the current state of the neurons of an <a class="el" href="classshark_1_1_r_b_m.html" title="stub for the RBM class. at the moment it is just a holder of the parameter set and the Energy.">RBM</a> to a new one and thus can be used to produce a Markov chain. The Gibbs Operator works by computing the conditional distribution of the hidden given the visible p(h|v) (or vice versa) and than samples the new hidden (or visible) state from it.</p>
<p>As an interesting twist, this operator can also be used to implement Flip-The-State sampling using two values alpha_visible and alpha_hidden both being between 0 and 1 (inclusively). for alpha_visible=alpha_hidden=0, pure gibbs sampling is performed. if for one of the layers, the value is not 0 a mixture of gibbs and flip-the-state sampling is performed. 1 equals to pure flip-the state sampling. The trick of this sampler is that it takes the previous state into account while sampling. If the current state has a low probability, the sampler jumps deterministically in another state with higher probability. This is counterbalanced by having a higher chance to jump away from this state. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00052">52</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="abcd709448bd459283e37ddde0d15e7fd" name="abcd709448bd459283e37ddde0d15e7fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abcd709448bd459283e37ddde0d15e7fd">&#9670;&#160;</a></span>HiddenSample</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef detail::GibbsSample&lt; typename RBMType::HiddenType::SufficientStatistics &gt; <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::HiddenSample</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the type of a concrete sample. </p>
<p>The operator holds a 'sample' of the visible and hidden neurons. Such a sample does not only contain the states of the neurons but all other information needed to approximate the gradient </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00063">63</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="a5b57c0bacafe33d8d3ed614d4dd5d6dd" name="a5b57c0bacafe33d8d3ed614d4dd5d6dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b57c0bacafe33d8d3ed614d4dd5d6dd">&#9670;&#160;</a></span>HiddenSampleBatch</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt;<a class="el" href="classshark_1_1_gibbs_operator.html#abcd709448bd459283e37ddde0d15e7fd">HiddenSample</a>&gt;::type <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::HiddenSampleBatch</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents the state of a batch of hidden samples and additional information required by the gradient. </p>
<p>Aside from the hidden state, this structure can also hold the actual values of the input, the phi-function and the sufficient statistics </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00073">73</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="a9de44a00cd05bc1736b0503d25af6bd4" name="a9de44a00cd05bc1736b0503d25af6bd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9de44a00cd05bc1736b0503d25af6bd4">&#9670;&#160;</a></span>RBM</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef RBMType <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::RBM</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00054">54</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="a41de7989f5420650970b7b4f024b7356" name="a41de7989f5420650970b7b4f024b7356"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41de7989f5420650970b7b4f024b7356">&#9670;&#160;</a></span>VisibleSample</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef detail::GibbsSample&lt; typename RBMType::VisibleType::SufficientStatistics &gt; <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::VisibleSample</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the type of a concrete sample. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00067">67</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="a0c5a9c2d399cebdb3e036a5803a1d28b" name="a0c5a9c2d399cebdb3e036a5803a1d28b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c5a9c2d399cebdb3e036a5803a1d28b">&#9670;&#160;</a></span>VisibleSampleBatch</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt;<a class="el" href="classshark_1_1_gibbs_operator.html#a41de7989f5420650970b7b4f024b7356">VisibleSample</a>&gt;::type <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::VisibleSampleBatch</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents the state of the visible units and additional information required by the gradient. </p>
<p>Aside from the visible state, this structure can also hold the actual values of the hidden input, the phi-function and the sufficient statistics </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00079">79</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a0ec0371d4776aba60fc305b8f10c53fb" name="a0ec0371d4776aba60fc305b8f10c53fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ec0371d4776aba60fc305b8f10c53fb">&#9670;&#160;</a></span>GibbsOperator()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::GibbsOperator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a9de44a00cd05bc1736b0503d25af6bd4">RBM</a> *&#160;</td>
          <td class="paramname"><em>rbm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>alphaVisible</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>alphaHidden</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs the Operator using an allready defined Distribution to sample from. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00082">82</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_gibbs_operator.html#a5b86661eecf7572addeb9c6c2ea50711">shark::GibbsOperator&lt; RBMType &gt;::setAlpha()</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8ba4607be52c15e7e69f8c10fa9ccf65" name="a8ba4607be52c15e7e69f8c10fa9ccf65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ba4607be52c15e7e69f8c10fa9ccf65">&#9670;&#160;</a></span>calculateEnergy()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">RealVector <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::calculateEnergy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> const &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> const &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculates the <a class="el" href="structshark_1_1_energy.html" title="The Energy function determining the Gibbs distribution of an RBM.">Energy</a> of a sample of the visible and hidden neurons created by this chain. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hiddenBatch</td><td>the batch of samples of the hidden neurons </td></tr>
    <tr><td class="paramname">visibleBatch</td><td>the batch of samples of the visible neurons (holding also the precomputed input of the visibles) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value of the energy function <br  />
 </dd></dl>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00182">182</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="a638bbd0ab5f18d7064c2d6fb9a4ac1db" name="a638bbd0ab5f18d7064c2d6fb9a4ac1db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a638bbd0ab5f18d7064c2d6fb9a4ac1db">&#9670;&#160;</a></span>createSample() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<div class="memtemplate">
template&lt;class States &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::createSample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">States const &amp;&#160;</td>
          <td class="paramname"><em>states</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates hidden/visible sample pairs from the states of the visible neurons, i.e. sets the visible units to the given states and samples hidden states based on the states of the visible units. This can directly be used to calculate the gradient. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hiddenBatch</td><td>the batch of hidden samples to be created </td></tr>
    <tr><td class="paramname">visibleBatch</td><td>the batch of visible samples to be created </td></tr>
    <tr><td class="paramname">states</td><td>the states of the visible neurons in the sample </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00173">173</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_gibbs_operator.html#a6cf9658a4eb72ac3dc3dbaa44a51c726">shark::GibbsOperator&lt; RBMType &gt;::createSample()</a>.</p>

</div>
</div>
<a id="a6cf9658a4eb72ac3dc3dbaa44a51c726" name="a6cf9658a4eb72ac3dc3dbaa44a51c726"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6cf9658a4eb72ac3dc3dbaa44a51c726">&#9670;&#160;</a></span>createSample() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<div class="memtemplate">
template&lt;class States , class BetaVector &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::createSample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">States const &amp;&#160;</td>
          <td class="paramname"><em>states</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BetaVector const &amp;&#160;</td>
          <td class="paramname"><em>beta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates hidden/visible sample pairs from the states of the visible neurons, i.e. sets the visible units to the given states and samples hidden states based on the states of the visible units. This can directly be used to calculate the gradient. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hiddenBatch</td><td>the batch of hidden samples to be created </td></tr>
    <tr><td class="paramname">visibleBatch</td><td>the batch of visible samples to be created </td></tr>
    <tr><td class="paramname">states</td><td>the states of the visible neurons in the sample </td></tr>
    <tr><td class="paramname">beta</td><td>the vector of inverse temperatures </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00157">157</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="namespaceshark.html#af2ab10364feb8a631e0866dcf2f1a4ad">shark::batchSize()</a>, <a class="el" href="classshark_1_1_gibbs_operator.html#a119948b017a9d29cdf5f10e20f4ed556">shark::GibbsOperator&lt; RBMType &gt;::precomputeHidden()</a>, <a class="el" href="classshark_1_1_gibbs_operator.html#ab653cc8b59970aa87a87c9c633ed3c14">shark::GibbsOperator&lt; RBMType &gt;::sampleHidden()</a>, and <a class="el" href="_exception_8h.html#a42a6a50e4d06c00d60fbca5333f40768">SIZE_CHECK</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a638bbd0ab5f18d7064c2d6fb9a4ac1db">shark::GibbsOperator&lt; RBMType &gt;::createSample()</a>, and <a class="el" href="classshark_1_1_exact_gradient.html#aef523213c55d8c9c6261abfe3c4c6bcf">shark::ExactGradient&lt; RBMType &gt;::evalDerivative()</a>.</p>

</div>
</div>
<a id="a119948b017a9d29cdf5f10e20f4ed556" name="a119948b017a9d29cdf5f10e20f4ed556"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a119948b017a9d29cdf5f10e20f4ed556">&#9670;&#160;</a></span>precomputeHidden()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<div class="memtemplate">
template&lt;class BetaVector &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::precomputeHidden </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BetaVector const &amp;&#160;</td>
          <td class="paramname"><em>beta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculates internal data needed for sampling the hidden units as well as requested information for the gradient. </p>
<p>This function calculates the conditional probability distribution p(h|v) with inverse temperature beta for the whole batch of samples Be aware that a change of temperature may occur between sampleVisible and precomputeHidden. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hiddenBatch</td><td>the batch of hidden samples to be created </td></tr>
    <tr><td class="paramname">visibleBatch</td><td>the batch of visible samples to be created </td></tr>
    <tr><td class="paramname">beta</td><td>the vector of inverse temperatures </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00101">101</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="_exception_8h.html#a42a6a50e4d06c00d60fbca5333f40768">SIZE_CHECK</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a6cf9658a4eb72ac3dc3dbaa44a51c726">shark::GibbsOperator&lt; RBMType &gt;::createSample()</a>, and <a class="el" href="classshark_1_1_gibbs_operator.html#a25136037254735170f4abf1659a0c56f">shark::GibbsOperator&lt; RBMType &gt;::stepVH()</a>.</p>

</div>
</div>
<a id="a196f8674930d1d17709900801f48243d" name="a196f8674930d1d17709900801f48243d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a196f8674930d1d17709900801f48243d">&#9670;&#160;</a></span>precomputeVisible()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<div class="memtemplate">
template&lt;class BetaVector &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::precomputeVisible </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BetaVector const &amp;&#160;</td>
          <td class="paramname"><em>beta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>calculates internal data needed for sampling the visible units as well as requested information for the gradient </p>
<p>This function calculates the conditional probability distribution p(v|h) with inverse temperature beta for a whole batch of inputs. Be aware that a change of temperature may occur between sampleHidden and precomputeVisible. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00114">114</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="_exception_8h.html#a42a6a50e4d06c00d60fbca5333f40768">SIZE_CHECK</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a25136037254735170f4abf1659a0c56f">shark::GibbsOperator&lt; RBMType &gt;::stepVH()</a>.</p>

</div>
</div>
<a id="a0f5eaa3488fc9152a26be8c4a9c11c41" name="a0f5eaa3488fc9152a26be8c4a9c11c41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f5eaa3488fc9152a26be8c4a9c11c41">&#9670;&#160;</a></span>rbm()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_gibbs_operator.html#a9de44a00cd05bc1736b0503d25af6bd4">RBM</a> * <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::rbm </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the internal <a class="el" href="classshark_1_1_r_b_m.html" title="stub for the RBM class. at the moment it is just a holder of the parameter set and the Energy.">RBM</a>. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00088">88</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

</div>
</div>
<a id="ab653cc8b59970aa87a87c9c633ed3c14" name="ab653cc8b59970aa87a87c9c633ed3c14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab653cc8b59970aa87a87c9c633ed3c14">&#9670;&#160;</a></span>sampleHidden()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::sampleHidden </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>sampleBatch</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Samples a new batch of states of the hidden units using their precomputed statistics. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00123">123</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a6cf9658a4eb72ac3dc3dbaa44a51c726">shark::GibbsOperator&lt; RBMType &gt;::createSample()</a>, and <a class="el" href="classshark_1_1_gibbs_operator.html#a25136037254735170f4abf1659a0c56f">shark::GibbsOperator&lt; RBMType &gt;::stepVH()</a>.</p>

</div>
</div>
<a id="a4e93543dc92f11037c60bedb0451d9be" name="a4e93543dc92f11037c60bedb0451d9be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e93543dc92f11037c60bedb0451d9be">&#9670;&#160;</a></span>sampleVisible()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::sampleVisible </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>sampleBatch</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Samples a new batch of states of the visible units using their precomputed statistics. </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00130">130</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a25136037254735170f4abf1659a0c56f">shark::GibbsOperator&lt; RBMType &gt;::stepVH()</a>.</p>

</div>
</div>
<a id="a5b86661eecf7572addeb9c6c2ea50711" name="a5b86661eecf7572addeb9c6c2ea50711"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b86661eecf7572addeb9c6c2ea50711">&#9670;&#160;</a></span>setAlpha()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::setAlpha </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>newAlphaVisible</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>newAlphaHidden</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00190">190</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="_exception_8h.html#adce1f80097c69010f5eab2618fa2e971">SHARK_RUNTIME_CHECK</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_gibbs_operator.html#a0ec0371d4776aba60fc305b8f10c53fb">shark::GibbsOperator&lt; RBMType &gt;::GibbsOperator()</a>.</p>

</div>
</div>
<a id="a25136037254735170f4abf1659a0c56f" name="a25136037254735170f4abf1659a0c56f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25136037254735170f4abf1659a0c56f">&#9670;&#160;</a></span>stepVH()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RBMType &gt; </div>
<div class="memtemplate">
template&lt;class BetaVector &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_gibbs_operator.html">shark::GibbsOperator</a>&lt; RBMType &gt;::stepVH </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a5b57c0bacafe33d8d3ed614d4dd5d6dd">HiddenSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>hiddenBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_gibbs_operator.html#a0c5a9c2d399cebdb3e036a5803a1d28b">VisibleSampleBatch</a> &amp;&#160;</td>
          <td class="paramname"><em>visibleBatch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>numberOfSteps</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BetaVector const &amp;&#160;</td>
          <td class="paramname"><em>beta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies the Gibbs operator a number of times to a given sample. </p>
<p>Performs one complete step for a sample by sampling first the hidden, than the visible and computing the probability of a hidden given the visible unit That is, Given a <a class="el" href="structshark_1_1_state.html" title="Represents the State of an Object.">State</a> (v,h), computes p(v|h),draws v and then computes p(h|v) and draws h . this is repeated several times </p>

<p class="definition">Definition at line <a class="el" href="_gibbs_operator_8h_source.html#l00140">140</a> of file <a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_gibbs_operator.html#a119948b017a9d29cdf5f10e20f4ed556">shark::GibbsOperator&lt; RBMType &gt;::precomputeHidden()</a>, <a class="el" href="classshark_1_1_gibbs_operator.html#a196f8674930d1d17709900801f48243d">shark::GibbsOperator&lt; RBMType &gt;::precomputeVisible()</a>, <a class="el" href="classshark_1_1_gibbs_operator.html#ab653cc8b59970aa87a87c9c633ed3c14">shark::GibbsOperator&lt; RBMType &gt;::sampleHidden()</a>, and <a class="el" href="classshark_1_1_gibbs_operator.html#a4e93543dc92f11037c60bedb0451d9be">shark::GibbsOperator&lt; RBMType &gt;::sampleVisible()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Unsupervised/RBM/Sampling/<a class="el" href="_gibbs_operator_8h_source.html">GibbsOperator.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
